<%--
  Created by IntelliJ IDEA.
  User: 我主人真帅!
  Date: 2020/10/12
  Time: 17:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <base href="<%=request.getContextPath()+"/"%>">
    <title>登录页面</title>
    <%--导入easyui的核心css文件--%>
    <link rel="stylesheet" href="easyui/themes/default/easyui.css">
    <%--导入easyui图标及css--%>
    <link rel="stylesheet" href="easyui/themes/icon.css">
    <%--导入基本默认css样式--%>
    <link rel="stylesheet" href="easyui/themes/demo.css">
    <%--导入jq依赖的js文件--%>
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <%--导入easyui核心js--%>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    
    <script type="text/javascript">
        $(function () {
            $("#btn2").click(function () {
                if ($("#uname").val()==""||$("#uname").val()==null){
                    $.messager.alert('警告','用户名不能为空！','error');
                    /*$.messager.confirm('警告','是否退出该系统！',function (r) {
                        alert(r);
                    });*/
                }else if($("#pwd").val()==""||$("#pwd").val()==null){
                    $.messager.alert('警告','密码不能为空！','error');
                }else {
                    $.post("AdminController/adminLogin",$("#fm").serialize(),function (result) {
                        if (result){
                            window.location.href="main.jsp";
                        }else {
                            $.messager.alert('警告','登录失败!','error');
                        }
                    })
                }
            })
        })
    </script>
</head>
<body>
<%--class:增加easyui的样式
    data-options:增加easyui的组件的
--%>
    <div style="margin-top: 200px;margin-left: 560px">
        <div style="width: 400px;height: 300px"  class="easyui-panel" title="登录" data-options="iconCls:'icon-save',closable:true,collapsible:true,minimizable:true,maximizable:true">
            <form id="fm">
                <div style="margin-top: 40px;margin-left: 100px">
                    <input id="uname" name="aname" type="text" class="easyui-textbox" data-options="iconCls:'icon-search'" prompt=用户名 style="width:60% " />
                </div>
                <div style="margin-top: 20px;margin-left: 100px">
                    <input id="pwd" name="apwd" type="text" class="easyui-passwordbox" prompt="密码" style="width:60%"/>
                </div>
                <div style="margin-top: 20px;margin-left: 100px">
                    <a id="btn1" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-clear'">clear</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <a id="btn2" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">login</a>
                </div>
            </form>
        </div>
    </div>
</body>
</html>
